package ae.pcfc.etks.online.common.domain;

import static javax.persistence.GenerationType.IDENTITY;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * ServiceAttrValue entity. @author Mohtisham.Salahria
 */
@Entity
@Table(name = "T_ETKS_SERVICE_ATTR_VALUE", schema = "ETKS_ONLINE_DBA")
public class ServiceAttrValue implements java.io.Serializable {

	// Fields

	/**
	 * 
	 */
	
	private static final long serialVersionUID = 1L;
	private Long serviceAttrValueId;
	private User User;
	private ServiceAttr ServiceAttr;
	private String serviceAttrValue;

	// Constructors

	/** default constructor */
	public ServiceAttrValue() {
	}

	/** minimal constructor */
	public ServiceAttrValue(ServiceAttr ServiceAttr,
			String serviceAttrValue) {
		this.ServiceAttr = ServiceAttr;
		this.serviceAttrValue = serviceAttrValue;
	}

	/** full constructor */
	public ServiceAttrValue(User User,
			ServiceAttr ServiceAttr, String serviceAttrValue) {
		this.User = User;
		this.ServiceAttr = ServiceAttr;
		this.serviceAttrValue = serviceAttrValue;
	}

	// Property accessors
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "SERVICE_ATTR_VALUE_ID", unique = true, nullable = false, precision = 11, scale = 0)
	public Long getServiceAttrValueId() {
		return this.serviceAttrValueId;
	}

	public void setServiceAttrValueId(Long serviceAttrValueId) {
		this.serviceAttrValueId = serviceAttrValueId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "USER_ID")
	public User getUser() {
		return this.User;
	}

	public void setUser(User User) {
		this.User = User;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "SERVICE_ATTR_ID", nullable = false)
	public ServiceAttr getServiceAttr() {
		return this.ServiceAttr;
	}

	public void setServiceAttr(ServiceAttr ServiceAttr) {
		this.ServiceAttr = ServiceAttr;
	}

	@Column(name = "SERVICE_ATTR_VALUE", length = 50)
	public String getServiceAttrValue() {
		return this.serviceAttrValue;
	}

	public void setServiceAttrValue(String serviceAttrValue) {
		this.serviceAttrValue = serviceAttrValue;
	}
}